#
#
#
#
#

CC=arm-linux-gcc#
LD=arm-linux-ld#
AR=arm-linux-ar#
LDFLAGS=-g
ARFLAGS=-r
CFLAGS=-I ../../srl_include -I ../../srl_include/comm -I ../../srl_include/drv -I ../../srl_include/head -I ../../srl_include/int -I ../../srl_include/kernel

vpath %.h ../../srl_include
vpath %.h ../../srl_include/comm
vpath %.h ../../srl_include/drv
vpath %.h ../../srl_include/head
vpath %.h ../../srl_include/int
vpath %.h ../../srl_include/kernel

MEM_TAG=k_mem.a# use static library
MEM_OBJ=mem_physical.o mem_mmu.o mem_slab.o mmu_int_handle.o
MEM_SRC=$(MEM_OBJ:.o=.c)
MEM_DEP=$(MEM_OBJ:.o=.d)

$(MEM_TAG):$(MEM_OBJ) $(MEM_DEP)
	$(AR) $(ARFLAGS) $@ $<

dep:$(MEM_DEP)
$(MEM_DEP):%.d:%.c
	rm -f $*.d;\
	gcc $(CFLAGS) -MM $<|sed 's,^.*:,$*.o:,' >log.$$$$1;\
	echo $(CC) $(CFLAGS) -c $< -o $*.o >log.$$$$2;\
	cat log.$$$$1 log.$$$$2|sed 's/^$(CC)/\t$(CC)/g' >$@;\
	rm -f log.$$$$*;\

include $(MEM_OBJ:.o=.d)

clean:
	rm -f $(MEM_DEP) $(MEM_OBJ) $(MEM_TAG)
